package shu;

import java.util.Scanner;

public class SeqBT {
    int MaxSize=50;
    int length;
    char[]btree;//
    public SeqBT(int maxSize) {
        MaxSize=maxSize;
        btree =new char[MaxSize];
    }
    public void CreatBT() {
        System.out.println("最大节点个数为"+MaxSize+",以编号0或字符#结束输入");
        Scanner sc=new Scanner(System.in);
        while (true) {
            System.out.print("请输入编号:");
            int i=sc.nextInt();
            System.out.print("请输入字符:");
            char c=sc.next().charAt(0);
            if(i==0 || c=='#')
                break;
            btree[i]=c;
        }
        sc.close();
    }
    public void print() {
        System.out.print("tree: ");
        for(int i=1;i<MaxSize;i++) {
            System.out.print(btree[i]);
        }
    }

}
